#include <blitz/array.h>
#include <iostream>
#include <clay/linear_algebra.h>
#include <complex>
#include <type_traits>
#include <memory>
#include <tuple>
#include <system/perform_and_measure_task.h>

using namespace std;

int main(int argc, char** argv)
{
	static constexpr int N = 100;
	task_timer<> timer;

	array<complex<double>, 3> a{N};
	array<complex<double>, 3> b{N};
	a = complex<double>{1.0, 0.0};
	b = complex<double>{2.0, 0.0};
	
	auto task = [&]()
	{
		for(int i =0; i<10;i++)
		a[1] += b[0];
	};
	
	timer.set_zero();
	timer( task );
	cout << a(2,2,2) << endl;	
	cout << "total = " << timer.get_total_time() << endl;

/*
	BZ_USING_NAMESPACE(blitz)
	Array<complex<double>, 1> A(N);
	Array<complex<double>, 1> B(N);
	A = complex<double>{1.0, 0.0};
	B = complex<double>{2.0, 0.0};
	
	auto task2 = [&]()
	{
		for(int i =0; i<10;i++)
		A[1] += B[0];
	};
	
	timer.set_zero();
	timer( task2 );
	cout << A(2) << endl;	
	cout << "total = " << timer.get_total_time() << endl;
	*/
}
